<!--
 * @Author: GGBeng
 * @Date: 2021-12-09 11:13:55
 * @LastEditTime: 2021-12-09 11:41:27
 * @LastEditors: Please set LastEditors
 * @Description: 设置页面
 * @FilePath: /hisapp/pages/setting/index.vue
-->
<template>
	<view class="setting">
		<uni-list>
			<uni-list-item
				v-for="item in list"
				:key="item.code"
				:title="item.title"
				link
				@click="handlerClick(item.code)"
			></uni-list-item>
		</uni-list>
	</view>
</template>

<script>
export default {
	data() {
		return {
			list: [
				{
					title: '更新头像昵称',
					code: 'gxnc',
				},
				{
					title: '用户协议',
					code: 'yhxy',
				},
				{
					title: '隐私协议',
					code: 'ysxy',
				},
			],
		}
	},
	methods: {
		handlerClick(code) {
			switch (code) {
				case 'gxnc':
					this.handlerUpdateUserInfo()
					break
			}
		},
		handlerUpdateUserInfo() {
			uni.getUserProfile({
				desc: '更新信息',
				lang: 'zh_CN',
				success: res => {
					// console.log(res)
				},
			})
		},
	},
}
</script>

<style lang="scss" >
</style>